package org.workdemo.back.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.workdemo.back.Enum.OperationType;
import org.workdemo.back.anno.AutoFill;
import org.workdemo.back.entity.DTO.BackPageQueryDTO;
import org.workdemo.back.entity.DzyhThb;

/**
 * @author xxliang
 * @Date 2025/3/29 12:12
 */

@Mapper
public interface BackMapper {

    /**
     * 依据GID查询
     * @param gid
     * @return
     */
    @Select("select * from XXLIANG.DZYH_THB where GID = #{gid}")
    DzyhThb getDzyhThbById(String gid);

    /**
     * 添加退货信息
     * @param dzyhThb
     */
    @AutoFill(OperationType.INSERT)
    void addBack(DzyhThb dzyhThb);

    /**
     * 依照GID删除订单信息
     * @param gid
     */
    @Delete("delete from XXLIANG.DZYH_THB where gid = #{gid}")
    void deleteBack(String gid);


    /**
     * 修改退货申请
     * @param dzyhThb
     */
    void updateBack(DzyhThb dzyhThb);

    /**
     * 分页查询
     * @param backPageQueryDTO
     * @return
     */
    Page<DzyhThb> pageQuery(BackPageQueryDTO backPageQueryDTO);
}
